<?xml version="1.0" encoding="utf-8"?>
<!--
	Copyright (C) 2010 Ethan Gruber
	EADitor: http://code.google.com/p/eaditor/
	Apache License 2.0: http://code.google.com/p/eaditor/    
-->
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www.w3.org/2001/xml-events"
	xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:widget="http://orbeon.org/oxf/xml/widget" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:ead="urn:isbn:1-931666-22-9"
	xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="urn:isbn:1-931666-22-9" xmlns:eaditor="http://code.google.com/p/eaditor/" xmlns:xxi="http://orbeon.org/oxf/xml/xinclude">
	<xhtml:head>
		<xhtml:title>EADitor: Edit Component</xhtml:title>
		<xhtml:link rel="stylesheet" type="text/css" href="/apps/eaditor/css/grids-min.css"/>
		<xhtml:link rel="stylesheet" type="text/css" href="/apps/eaditor/css/reset-fonts-grids.css"/>
		<xhtml:link rel="stylesheet" type="text/css" href="/apps/eaditor/css/base-min.css"/>
		<xhtml:link rel="stylesheet" type="text/css" href="/apps/eaditor/css/fonts-min.css"/>

		<!-- EADitor styling -->
		<xhtml:link rel="stylesheet" href="/apps/eaditor/css/style.css"/>
		<xhtml:link rel="stylesheet" href="/apps/eaditor/css/themes/smoothness.css"/>
		<xhtml:script type="text/javascript" src="/apps/eaditor/javascript/jquery-1.4.2.min.js"/>
		<xhtml:script type="text/javascript" src="/apps/eaditor/javascript/menu.js"/>

		<xforms:model>
			<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified">
				<xs:simpleType name="iso8601date">
					<xs:restriction base="xs:string">
						<xs:pattern
							value="(\-?(0|1|2)([0-9]{3})(((01|02|03|04|05|06|07|08|09|10|11|12)((0[1-9])|((1|2)[0-9])|(3[0-1])))|\-((01|02|03|04|05|06|07|08|09|10|11|12)(\-((0[1-9])|((1|2)[0-9])|(3[0-1])))?))?)(/\-?(0|1|2)([0-9]{3})(((01|02|03|04|05|06|07|08|09|10|11|12)((0[1-9])|((1|2)[0-9])|(3[0-1])))|\-((01|02|03|04|05|06|07|08|09|10|11|12)(\-((0[1-9])|((1|2)[0-9])|(3[0-1])))?))?)?"
						/>
					</xs:restriction>
				</xs:simpleType>
			</xs:schema>

			<xforms:instance id="guide">
				<ead id="" xmlns="urn:isbn:1-931666-22-9"/>
			</xforms:instance>

			<!-- exist URL is stored in an XML file -->
			<xforms:instance id="exist-url">
				<xi:include href="exist-url.xml"/>
			</xforms:instance>

			<xforms:instance id="config">
				<config xmlns=""/>
			</xforms:instance>

			<!-- get from exist -->
			<xforms:instance id="c-template">
				<c xmlns="urn:isbn:1-931666-22-9"/>
			</xforms:instance>

			<!-- table of contents for navigation -->
			<xforms:instance id="toc">
				<dsc xmlns=""/>
			</xforms:instance>

			<xforms:instance id="status">
				<status/>
			</xforms:instance>

			<xforms:instance id="identifier">
				<id xmlns=""/>
			</xforms:instance>

			<xforms:instance id="page">
				<page xmlns=""/>
			</xforms:instance>

			<!-- solr response for id query -->
			<xforms:instance id="is-published">
				<response xmlns=""/>

			</xforms:instance>
			<!-- send to Solr -->
			<xforms:instance id="addIndex">
				<add xmlns=""/>
			</xforms:instance>

			<!-- Instance for Solr commit-->
			<xforms:instance id="sendCommit">
				<commit/>
			</xforms:instance>

			<xforms:instance id="level-template">
				<levels xmlns="">
					<level value="">Select...</level>
					<level value="class">Class</level>
					<level value="collection">Collection</level>
					<level value="file">File</level>
					<level value="fonds">Fonds</level>
					<level value="item">Item</level>
					<level value="recordgrp">Record Group</level>
					<level value="series">Series</level>
					<level value="subfonds">Subfonds</level>
					<level value="subgrp">Subgroup</level>
					<level value="subseries">Subseries</level>
					<level value="otherlevel">Other Level</level>
				</levels>
			</xforms:instance>

			<xforms:bind node="instance('guide')">
				<xforms:bind nodeset="//*/@id" type="xs:ID"/>
				<xforms:bind nodeset="@id" required="true()"/>
				<xforms:bind nodeset="ead:archdesc">
					<xforms:bind nodeset="//ead:defitem">
						<xforms:bind nodeset="ead:label" required="true()"/>
						<xforms:bind nodeset="ead:item" required="true()"/>
					</xforms:bind>
					<xforms:bind nodeset="ead:dsc">
						<xforms:bind nodeset="//ead:c">
							<xforms:bind nodeset="@id" required="true()"/>
							<xforms:bind nodeset="@level" required="true()"/>
							<xforms:bind nodeset="@otherlevel" type="xs:NMTOKEN"/>
							<xforms:bind nodeset="ead:did/ead:unittitle" required="true()"/>
						</xforms:bind>
					</xforms:bind>
				</xforms:bind>
				<xforms:bind nodeset="//ead:tgroup/@cols" required="true()" type="xs:integer"/>
				<xforms:bind nodeset="//ead:listhead">
					<xforms:bind nodeset="ead:head01" required="true()"/>
					<xforms:bind nodeset="ead:head02" required="true()"/>
				</xforms:bind>
				<xforms:bind nodeset="//ead:ref" required="true()"/>
				<xforms:bind nodeset="//ead:extref" required="true()">
					<xforms:bind nodeset="@xlink:href" required="true()"/>
				</xforms:bind>
				<xforms:bind nodeset="//ead:dao/@xlink:href" required="true()"/>
				<xforms:bind nodeset="//ead:daoloc/@xlink:href" required="true()"/>
				<xforms:bind nodeset="//ead:daoloc/@xlink:label" constraint="string-length(.) &gt; 0"/>
				<xforms:bind nodeset="//ead:unitdate/@normal" type="iso8601date"/>
				<xforms:bind nodeset="//ead:date/@normal" type="iso8601date"/>
				<xforms:bind nodeset="//ead:p">
					<xforms:bind constraint="string-length(.) &gt; 0"/>
				</xforms:bind>
			</xforms:bind>

			<!-- load preliminary instances -->
			<xforms:submission id="load-config" serialization="none" method="get" action="{instance('exist-url')}eaditor/config.xml" replace="instance" instance="config"/>
			<xforms:submission id="load-c-template" serialization="none" method="get" action="{instance('exist-url')}eaditor/c-template.xml" replace="instance" instance="c-template"
				xxforms:username="admin" xxforms:password=""/>

			<!-- Submission to get the document -->
			<xforms:submission id="load-submission" serialization="none" method="get" action="{instance('exist-url')}eaditor/guides/{instance('guide')/@id}.xml" replace="instance" instance="guide"
				xxforms:username="admin" xxforms:password="">
				<xforms:message ev:event="xforms-submit-error" level="modal">Unable to load finding aid</xforms:message>
				<xforms:send submission="load-toc" ev:event="xforms-submit-done"/>
			</xforms:submission>
			<!-- load table of contents after loading the ead guide -->
			<xforms:submission id="load-toc" serialization="none" method="get" action="../../toc/{instance('guide')/@id}" replace="instance" instance="toc">
				<xforms:message ev:event="xforms-submit-error" level="modal">Unable to load table of contents</xforms:message>
			</xforms:submission>

			<!-- Submission to save the document -->
			<xforms:submission id="save-submission" ref="instance('guide')" action="{instance('exist-url')}eaditor/guides/{instance('guide')/@id}.xml" method="put" replace="none"
				xxforms:username="admin" xxforms:password="">
				<xforms:message ev:event="xforms-submit-error" level="modal">Error Saving Documents. Be sure all required inputs are filled in.</xforms:message>
				<xforms:action ev:event="xforms-submit-done">
					<xforms:setvalue ref="instance('status')">EAD guide saved.</xforms:setvalue>
					<!-- post to Solr unpublished core -->
					<xforms:insert nodeset="instance('addIndex')" origin="xxforms:call-xpl('oxf:/apps/eaditor/xpl/ead-unpublish.xpl', 'data', instance('guide'), 'data')"/>
					<!-- check to see if the document is already published to Solr -->
					<xforms:send submission="unpublish-submission"/>
					<xforms:send submission="query-solr-for-publication"/>
					<!-- reload toc -->
					<xforms:send submission="load-toc"/>
				</xforms:action>
			</xforms:submission>

			<!-- submission to query solr to see if the document is published -->

			<xforms:submission id="query-solr-for-publication" serialization="none" method="get" action="{instance('config')/solr_published}select/?q=id:{instance('guide')/@id}" replace="instance"
				instance="is-published">
				<!-- if the document is found in solr, get the updated solr doc -->
				<xforms:send ev:event="xforms-submit-done" if="instance('is-published')/result[@name='response']/@numFound = '1'" submission="ead-publish"/>
			</xforms:submission>

			<!-- access service to read in pre-transformed solr doc -->
			<xforms:submission id="ead-publish" method="get" replace="instance" instance="addIndex" serialization="none" resource="/eaditor/solr/{instance('guide')/@id}">
				<xforms:message ev:event="xforms-submit-error" level="modal">Error transforming EAD guide to Solr document.</xforms:message>
				<xforms:send ev:event="xforms-submit-done" submission="publish-submission"/>
			</xforms:submission>

			<!-- post instance to Solr -->
			<xforms:submission id="publish-submission" action="{instance('config')/solr_published}update" ref="instance('addIndex')" instance="addIndex" replace="instance" method="post">
				<xforms:send ev:event="xforms-submit-done" submission="submit-commit"/>
				<xforms:setvalue ev:event="xforms-submit-done" ref="instance('status')">EAD guide saved and updated to search index.</xforms:setvalue>
				<xforms:message ev:event="xforms-submit-error" level="modal">Data Failed to POST to Solr. Index may be offline or URL is incorrect.</xforms:message>
			</xforms:submission>

			<!-- for unpublished documents, always save to unpublished core -->
			<!-- post instance to Solr -->
			<xforms:submission id="unpublish-submission" action="{instance('config')/solr_unpublished}update" ref="instance('addIndex')" instance="addIndex" replace="instance" method="post">
				<xforms:send ev:event="xforms-submit-done" submission="submit-unpublished-commit"/>
				<xforms:setvalue ev:event="xforms-submit-done" ref="instance('status')">EAD guide saved.</xforms:setvalue>
				<xforms:message ev:event="xforms-submit-error" level="modal">Data Failed to POST to Solr. Index may be offline or URL is incorrect.</xforms:message>
			</xforms:submission>
			<!-- send commit -->
			<xforms:submission id="submit-unpublished-commit" action="{instance('config')/solr_unpublished}update" ref="instance('sendCommit')" instance="sendCommit" replace="none" method="post"/>

			<!-- send commit -->
			<xforms:submission id="submit-commit" action="{instance('config')/solr_published}update" ref="instance('sendCommit')" instance="sendCommit" replace="none" method="post"/>

			<!-- ************************ xforms-model-construct-done ****************************** -->
			<!-- load ids from parameters and load the document -->
			<xforms:action ev:event="xforms-model-construct-done">
				<xforms:setvalue ref="instance('guide')/@id" value="xxforms:get-request-parameter('guide')"/>
				<xforms:setvalue ref="instance('identifier')" value="xxforms:get-request-parameter('component')"/>
				<xforms:send submission="load-config"/>
				<xforms:send submission="load-submission"/>
				<xforms:send submission="load-c-template"/>
			</xforms:action>
		</xforms:model>

		<!-- xbl components -->
		<xi:include href="oxf:/xbl/eaditor/access-elements/access-elements.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/accessrestrict/accessrestrict.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/accruals/accruals.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/acqinfo/acqinfo.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/address/address.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/altformavail/altformavail.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/appraisal/appraisal.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/arrangement/arrangement.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/attributes/attributes.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/author/author.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/bibliography/bibliography.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/bibref/bibref.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/bioghist/bioghist.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/blockquote/blockquote.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/c/c.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/chronlist/chronlist.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/component-level/component-level.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/controlaccess/controlaccess.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/corpname/corpname.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/creation/creation.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/custodhist/custodhist.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/dao/dao.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/daodesc/daodesc.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/daogrp/daogrp.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/daoloc/daoloc.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/date/date.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/did/did.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/descgrp/descgrp.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/extptrloc/extptrloc.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/extref/extref.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/extrefloc/extrefloc.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/famname/famname.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/fileplan/fileplan.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/function/function.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/generic-elements/generic-elements.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/genreform/genreform.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/geogname/geogname.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/head/head.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/index/index.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/linkgrp/linkgrp.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/list/list.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/listhead/listhead.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/name/name.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/namegrp/namegrp.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/navigation/navigation.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/note/note.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/num/num.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/occupation/occupation.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/odd/odd.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/originalsloc/originalsloc.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/otherfindaid/otherfindaid.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/p/p.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/persname/persname.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/phystech/phystech.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/prefercite/prefercite.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/processinfo/processinfo.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/ptr/ptr.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/ptrgrp/ptrgrp.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/ptrloc/ptrloc.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/publisher/publisher.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/ref/ref.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/refloc/refloc.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/relatedmaterial/relatedmaterial.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/scopecontent/scopecontent.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/separatedmaterial/separatedmaterial.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/sponsor/sponsor.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/subject/subject.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/subtitle/subtitle.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/table/table.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/title/title.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/titleproper/titleproper.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/unitdate/unitdate.xbl" xxi:omit-xml-base="true"/>
		<xi:include href="oxf:/xbl/eaditor/userestrict/userestrict.xbl" xxi:omit-xml-base="true"/>
	</xhtml:head>
	<xhtml:body class="yui-skin-sam">
		<xhtml:div id="doc4" class="yui-t2">
			<!-- header -->
			<xxforms:variable name="display_path">../../../</xxforms:variable>
			<xi:include href="header-admin.xml"/>

			<xhtml:div id="bd">
				<xforms:group ref="instance('status')/text()">
					<xhtml:div class="success">
						<xforms:output ref="instance('status')"/>
					</xhtml:div>
				</xforms:group>
				<xhtml:p>
					<xhtml:a href="../../">&lt; Return</xhtml:a>
				</xhtml:p>
				<xhtml:div id="yui-main">
					<xhtml:div class="yui-b">
						<xhtml:div id="form">
							<!-- This table contains the main actions for the page  -->
							<xhtml:div class="submission">
								<xforms:submit submission="save-submission" appearance="minimal">
									<xforms:label><xhtml:img src="/apps/eaditor/images/save.gif" alt="Save"/> Save</xforms:label>
								</xforms:submit>
								<xforms:submit submission="load-submission" appearance="minimal">
									<xforms:label><xhtml:img src="/apps/eaditor/images/recycle-green.png" alt="Revert"/>Load</xforms:label>
								</xforms:submit>
							</xhtml:div>


							<xforms:group ref="instance('guide')/descendant::ead:c[@id=instance('identifier')]">
								<xxforms:variable name="level" select="@level"/>
								<xhtml:h2>Edit Component</xhtml:h2>
								<eaditor:attributes ref="."/>
								<xhtml:div class="section">
									<xhtml:div>
										<xforms:input ref="@id">
											<xforms:label>Component ID</xforms:label>
											<xforms:alert>Required</xforms:alert>
										</xforms:input>
									</xhtml:div>
									<xhtml:div>
										<xforms:select1 ref="@level">
											<xforms:label>Level</xforms:label>
											<xforms:itemset nodeset="instance('level-template')/level">
												<xforms:label ref="."/>
												<xforms:value ref="@value"/>
											</xforms:itemset>
											<!-- create otherlevel attribute or delete it, depending on @level value -->
											<xforms:action ev:event="xforms-value-changed">
												<xforms:insert if="$level='otherlevel'" context="instance('guide')/descendant::ead:c[@id=instance('identifier')]"
													origin="xxforms:attribute('otherlevel', '')"/>
												<xforms:delete if="$level != 'otherlevel'" context="instance('guide')/descendant::ead:c[@id=instance('identifier')]" nodeset="@otherlevel"/>
											</xforms:action>
										</xforms:select1>
									</xhtml:div>
									<xforms:group ref=".[@level='otherlevel']">
										<xhtml:div>
											<xforms:input ref="@otherlevel">
												<xforms:label>Other Level</xforms:label>
												<xforms:alert>Must be a valid nametoken</xforms:alert>
											</xforms:input>
										</xhtml:div>
									</xforms:group>
									<xforms:group ref=".[string(@audience)]">
										<xhtml:div>
											<xforms:output ref="@audience">
												<xforms:label>Audience</xforms:label>
											</xforms:output>
										</xhtml:div>
									</xforms:group>
								</xhtml:div>
								<widget:tabs>
									<!--**************************************** DESCRIPTIVE INFORMATION - DID **********************************-->
									<widget:tab id="did">
										<widget:label>Descriptive Identification</widget:label>
										<!-- did-level instances -->
										<xhtml:div class="section">
											<xforms:group ref="ead:did">
												<eaditor:did/>
											</xforms:group>
										</xhtml:div>
									</widget:tab>
									<!--**************************************** END DESCRIPTIVE INFORMATION - DID **********************************-->
									<!--**************************************** COMPONENT-LEVEL INFORMATION **********************************-->
									<widget:tab id="c-level">
										<widget:label>C-level Information</widget:label>
										<!-- include component-level information.  this is broken into a separate XML file so that it can be used in the top-level ead form -->
										<xhtml:div class="section">
											<eaditor:component-level/>
										</xhtml:div>
									</widget:tab>
									<!--**************************************** END COMPONENT-LEVEL INFORMATION **********************************-->
									<!--**************************************** SUB COMPONENTS **********************************-->
									<widget:tab id="subcomponents">
										<widget:label>Subcomponents</widget:label>
										<xhtml:h1>Subcomponents</xhtml:h1>
										<xhtml:div>
											<xforms:trigger appearance="minimal">
												<xforms:label>
													<xhtml:img src="/apps/eaditor/images/add.gif"/>Subcomponent</xforms:label>
												<xforms:insert ev:event="DOMActivate" context="." nodeset="./child::node()[last()]" origin="instance('c-template')"/>
												<xforms:action ev:event="DOMActivate">
													<xforms:setvalue ref="ead:c[last()]/@id" value="concat('c_', string(digest( string( random( true ) ), 'MD5', 'hex' )))"/>
												</xforms:action>
											</xforms:trigger>
										</xhtml:div>

										<xhtml:div class="section">
											<xforms:repeat nodeset="ead:c">
												<eaditor:c/>
											</xforms:repeat>
										</xhtml:div>
									</widget:tab>
									<!--**************************************** END SUB COMPONENTS **********************************-->
									<!--<widget:tab id="preview">
										<widget:label>XML Preview</widget:label>
										<xhtml:h1>XML Preview</xhtml:h1>
										<widget:xforms-instance-inspector id="orbeon-xforms-inspector"
										xmlns:widget="http://orbeon.org/oxf/xml/widget"/>
										</widget:tab>-->
								</widget:tabs>
							</xforms:group>
						</xhtml:div>
					</xhtml:div>
				</xhtml:div>
				<xhtml:div class="yui-b">
					<eaditor:navigation ref="instance('toc')" depth="8"/>
				</xhtml:div>
			</xhtml:div>

			<!-- footer -->
			<xi:include href="xslt/footer.xml"/>
		</xhtml:div>
	</xhtml:body>
</xhtml:html>
